package J1;

import org.testng.Assert;
import org.testng.annotations.Test;

public class Test_1 {
//    priority = 0，测试用例优先级最高，不带该参数默认优先级为0
//    dependsOnMethods，看字面意思可以知道。如果要运行当前的测试用例，需要先运行指定的依赖方法后，再运行当前用例。
    @Test(dependsOnMethods = {"test_02"})
    public void test_01(){
        System.out.println("用例m1！");
    }
    @Test()
    public void test_02(){
        System.out.println("用例m2！");
    }
    @Test(priority = 3)
    public void test_03(){
        System.out.println("用例m3！");
//        Assert.assertEquals(100,100,"不相等");
        String[] a={"1","2","3"};
        String[] b={"3","2","1"};
        Assert.assertEqualsNoOrder(a,b,"不同");
    }
    @Test(priority = 2)
    public void test_04(){
        System.out.println("用例m4！");
    }
//   设置了执行次数数5次，5次执行总共耗时不能超过5100毫秒，否则抛出中断异常。
    @Test(priority = 1,invocationCount = 5, invocationTimeOut = 9000)
    public void test_05() throws InterruptedException {
        Thread.sleep(100);
        System.out.println("用例m5！");
    }
}
